Platform Explorer / Nuxeo Platform 5.8

Component org.nuxeo.ecm.social.user.relationship.layout

Contributions

XML Source

<component name="org.nuxeo.ecm.social.user.relationship.layout">

  <require>org.nuxeo.ecm.user.center.profile.layouts</require>

  <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
    point="layouts">

    <!-- override userprofile layout -->
    <layout name="userprofile">
      <templates>
        <template mode="any">/layouts/layout_default_template.xhtml
        </template>
      </templates>

      <rows>
        <row>
          <widget>avatar</widget>
        </row>
        <row>
          <widget>birthdate</widget>
        </row>
        <row>
          <widget>phonenumber</widget>
        </row>
        <row>
          <widget>gender</widget>
        </row>
        <row>
          <widget>publicprofile</widget>
        </row>
      </rows>
    </layout>

    <!-- override summary layout from user_profile -->
    <layout name="summary_user_profile_layout">
      <templates>
        <template mode="any">/layouts/layout_summary_template.xhtml</template>
      </templates>
      <rows>
        <row>
          <widget>summary_user_profile</widget>
        </row>
        <row>
          <widget>summary_user_relationship</widget>
        </row>
      </rows>
    </layout>

    <layout name="user_relationship">
      <templates>
        <template mode="any">/layouts/layout_div_template.xhtml</template>
      </templates>
      <rows>
        <row>
          <widget>user_relationship_add</widget>
        </row>
        <row>
          <widget>user_relationship_contacts</widget>
        </row>
      </rows>
    </layout>

    <layout name="relationships_listing">
      <templates>
        <template mode="any">/layouts/layout_listing_template.xhtml</template>
      </templates>
      <columns>
        <column>
          <properties mode="any">
            <property name="useFirstWidgetLabelAsColumnHeader">false</property>
            <property name="columnStyleClass">pictureColumn</property>
          </properties>
          <widget>user_relationship_avatar</widget>
        </column>
        <column>
          <properties mode="any">
            <property name="useFirstWidgetLabelAsColumnHeader">false</property>
          </properties>
          <widget>user_relationship_username</widget>
        </column>
        <column>
          <properties mode="any">
            <property name="useFirstWidgetLabelAsColumnHeader">false</property>
          </properties>
          <widget>listing_user_relationship_add</widget>
        </column>
      </columns>
    </layout>
  </extension>

  <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
    point="widgettypes">
    <widgetType name="summary_user_relationship">
      <configuration>
        <sinceVersion>5.5</sinceVersion>
        <title>User Relationships Summary</title>
        <description>
          <p>This widgets displays the user_relationship layout.</p>
        </description>
        <categories>
          <category>summary</category>
        </categories>
        <supportedModes>
          <mode>view</mode>
        </supportedModes>
        <!-- no configurable properties -->
      </configuration>
      <handler-class>
        org.nuxeo.ecm.platform.forms.layout.facelets.plugins.TemplateWidgetTypeHandler
      </handler-class>
      <property name="template">
        /widgets/summary/user_relationship_widget_template.xhtml
      </property>
    </widgetType>

    <widgetType name="manage_user_relations">
      <configuration>
        <sinceVersion>5.5</sinceVersion>
        <title>User Manage Relations</title>
        <description>
          <p>This widget will manage user relations</p>
        </description>
        <categories>
          <category>summary</category>
        </categories>
        <supportedModes>
          <mode>any</mode>
        </supportedModes>
        <properties>
          <layouts mode="any">
            <layout
              name="manage_user_relations_widget_type_properties_any">
              <rows>
                <row>
                  <widget>panelIdsToBeReRendered</widget>
                </row>
              </rows>
              <widget name="panelIdsToBeReRendered" type="text">
                <labels>
                  <label mode="any">Panel IDs to be reRendered</label>
                </labels>
                <helpLabels>
                  <label mode="any">
                    The list of panel IDs to be reRendered separated by coma.
                  </label>
                </helpLabels>
                <fields>
                  <field>panelIdsToBeReRendered</field>
                </fields>
              </widget>
            </layout>
          </layouts>
        </properties>
      </configuration>
      <handler-class>
        org.nuxeo.ecm.platform.forms.layout.facelets.plugins.TemplateWidgetTypeHandler
      </handler-class>
      <property name="template">
        /widgets/user_relationship_add_widget_template.xhtml
      </property>
    </widgetType>

  </extension>

  <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
    point="widgets">

    <widget name="summary_user_relationship" type="summary_user_relationship" />

    <widget name="user_relationship_add" type="manage_user_relations">
      <fields>
        <field/>
      </fields>
    </widget>

    <widget name="listing_user_relationship_add" type="manage_user_relations">
      <fields>
        <field>data</field>
      </fields>
      <properties mode="any">
        <property name="panelIdsToBeReRendered">usersListingRelationshipPanel,userNetworkPanel</property>
      </properties>
    </widget>

    <widget name="user_relationship_contacts" type="template">
      <labels>
        <label mode="any">label.social.user.widget.relationships</label>
      </labels>
      <translated>true</translated>
      <fields>
        <field />
      </fields>
      <properties mode="any">
        <property name="template">/widgets/user_relationship_contacts_widget_template.xhtml</property>
      </properties>
      <widgetModes>
        <mode value="any">view</mode>
      </widgetModes>
    </widget>

    <widget name="user_relationship_relations" type="template">
      <fields>
        <field>data</field>
      </fields>
      <properties mode="any">
        <property name="template">/widgets/user_relationship_relation_with_user.xhtml</property>
      </properties>
      <widgetModes>
        <mode value="any">view</mode>
      </widgetModes>
    </widget>

    <widget name="user_relationship_username" type="template">
      <fields>
        <field>data</field>
      </fields>
      <properties mode="any">
        <property name="template">/widgets/user_relationship_profile_username_widget_template.xhtml</property>
      </properties>
      <widgetModes>
        <mode value="any">view</mode>
      </widgetModes>
    </widget>

    <widget name="user_relationship_avatar" type="avatar">
      <labels>
        <label mode="any">label.userprofile.avatar</label>
      </labels>
      <translated>true</translated>
      <helpLabels>
        <label mode="edit">
          helplabel.userprofile.avatar
        </label>
      </helpLabels>
      <fields>
        <field>data</field>
      </fields>
      <properties mode="any">
        <property name="file_property_name">userprofile:avatar</property>
      </properties>
    </widget>

    <!-- override to manage public/private profile -->
    <widget name="avatar" type="avatar">
      <labels>
        <label mode="any">label.userprofile.avatar</label>
      </labels>
      <translated>true</translated>
      <helpLabels>
        <label mode="edit">
          helplabel.userprofile.avatar
        </label>
      </helpLabels>
      <fields>
        <field></field>
        <field>userprofile:avatar</field>
      </fields>
      <properties mode="any">
        <property name="file_property_name">userprofile:avatar</property>
      </properties>
      <widgetModes>
        <mode value="view">#{userRelationshipActions.canViewProfile(layoutValue) ? 'view' : 'hidden'}</mode>
      </widgetModes>
    </widget>

    <!-- override to manage public/private profile -->
    <widget name="birthdate" type="datetime">
      <labels>
        <label mode="any">label.userprofile.birthdate</label>
      </labels>
      <translated>true</translated>
      <helpLabels>
        <label mode="edit">
          helplabel.userprofile.birthdate
        </label>
      </helpLabels>
      <fields>
        <field>userprofile:birthdate</field>
      </fields>
      <properties widgetMode="any">
        <property name="pattern">#{nxu:basicDateFormater()}</property>
      </properties>
      <properties widgetMode="edit">
        <property name="format">#{nxu:basicDateFormater()}</property>
      </properties>
      <widgetModes>
        <mode value="view">#{userRelationshipActions.canViewProfile(layoutValue) ? 'view' : 'hidden'}</mode>
      </widgetModes>
    </widget>

    <!-- override to manage public/private profile -->
    <widget name="phonenumber" type="text">
      <labels>
        <label mode="any">label.userprofile.phonenumber</label>
      </labels>
      <translated>true</translated>
      <fields>
        <field>userprofile:phonenumber</field>
      </fields>
      <properties widgetMode="edit">
        <property name="styleClass">dataInputText</property>
      </properties>
      <widgetModes>
        <mode value="view">#{userRelationshipActions.canViewProfile(layoutValue) ? 'view' : 'hidden'}</mode>
      </widgetModes>
    </widget>

    <!-- override to manage public/private profile -->
    <widget name="gender" type="template">
      <labels>
        <label mode="any">label.userprofile.gender</label>
      </labels>
      <translated>true</translated>
      <fields>
        <field>userprofile:gender</field>
      </fields>
      <properties mode="any">
        <property name="template">/widgets/gender_widget_template.xhtml
        </property>
      </properties>
      <widgetModes>
        <mode value="view">#{userRelationshipActions.canViewProfile(layoutValue) ? 'view' : 'hidden'}</mode>
      </widgetModes>
    </widget>

    <widget name="publicprofile" type="checkbox">
      <labels>
        <label mode="any">label.socialprofile.publicprofile</label>
      </labels>
      <translated>true</translated>
      <fields>
        <field>socialprofile:publicprofile</field>
      </fields>
      <properties widgetMode="edit">
        <property name="styleClass">dataInputText</property>
      </properties>
       <widgetModes>
        <mode value="view">#{userRelationshipActions.canViewProfile(layoutValue) ? 'view' : 'hidden'}</mode>
      </widgetModes>
    </widget>
  </extension>

</component>